//
// Created by 98770 on 2022/11/21.
//

#ifndef HUFFMAN_COMPLIER_HUFFMAN_TREE_H
#define HUFFMAN_COMPLIER_HUFFMAN_TREE_H

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <memory.h>

#define OK 1
#define ERROR 0

typedef struct Unit HTNode;
typedef struct Unit *Huffman_Tree;

void free_tree(Huffman_Tree T);

Huffman_Tree init_huffman_tree(Huffman_Tree ori_buf);

void Select(Huffman_Tree ori_buf, int arrange, int *s1, int *s2);

int save_tree(Huffman_Tree ori);

Huffman_Tree load_tree();

void show_huffman_tree(Huffman_Tree t, int node, int n);

void Encode(Huffman_Tree t);

void Decode(Huffman_Tree t);

void ShowInstructions();

#endif //HUFFMAN_COMPLIER_HUFFMAN_TREE_H
